<?php

namespace App\Admin\Controllers\Api;

use App\Http\Controllers\Controller;

class CountsController extends Controller
{
	public function userIncrease()
	{
		$labels = $data = [];
		/*foreach (counter('chart')->usersIncreasing('vip') as $item) {
			$labels[] = $item['date'];
			$data['vip'][] = $item['count'];
		}
		foreach (counter('chart')->usersIncreasing('normal') as $item) {
			$data['normal'][] = $item['count'];
		}*/
		return ['labels' => $labels, 'data' => $data];
	}
	
	public function userConsist()
	{
		$labels = $data = [];
		/*foreach (counter('chart')->usersConsisting() as $item) {
			$labels[] = $item['grade'];
			$data[] = $item['count'];
		}*/
		return $data;
	}
	
	public function everydayProfit()
	{
		$labels = $data = [];
		/*foreach (counter('chart')->profitIncreasing('vip') as $item) {
			$labels[] = $item['date'];
			$data['vip'][] = $item['sum'];
		}
		foreach (counter('chart')->profitIncreasing('order') as $item) {
			$data['order'][] = $item['sum'];
		}*/
		return ['labels'=> $labels, 'data' => $data];
	}
}
